<template name="ChatListItem">
  <div class="thread-icon {{#unless read}}unread{{/unless}}">
    {{> avatar user=chat shape="circle" class="" size="medium"}}
    <span class="red-point"></span>
  </div>
  <div class="thread-title">
    <small class="pull-right text-muted">{{formatSimpleDate updatedAt}}</small>
    <div class="thread-subject text-ellipsis">{{threadTitle this}}</div>
    <div class="message-summary text-ellipsis text-muted">
      {{lastMessage.localizedSummary}}
    </div>
  </div>
</template>

<template name="SimpleChatListItem">
  <div class="thread-icon">
    {{> avatar user=chat shape="circle" class="" size="medium"}}
  </div>
  <div class="thread-title">
    <div class="thread-subject text-ellipsis">{{threadTitle this}}</div>
    <div class="message-summary text-ellipsis text-muted">
      {{chat.email}}
    </div>
  </div>
</template>

<template name="ThreadDetailChat">
  <div class="panel flat-panel">
    <div class="flat-panel-heading">
      <div class="flat-panel-title"><i class="{{threadIcon this}} text-success"></i> {{detailTitle}}</div>
    </div>
    <div class="flat-panel-body no-padding">
      <ul class="list-group members-list">
        {{#with chat}}
          {{#LinkToCardModal user=this class="list-group-item members-item clearfix"}}
            <span class="pull-left">
              {{> avatar user=this shape="circle" class="img-circle pull-left" size="small"}}
            </span>
            <div class="members-info">
              <strong class="name">{{name}}</strong> <span>{{title}}</span>
              <div class="text-muted text-ellipsis">{{email}}</div>
            </div>
          {{/LinkToCardModal}}
        {{/with}}
        {{> LinkToCreateGroup users=includeUsers}}
      </ul>
    </div>
  </div>
</template>
